<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="sf" uri="http://www.springframework.org/tags/form"%>
<%-- <script src="<c:url value='/js/jquery.min.js'/>"></script> --%>
<script src="<c:url value='/js/jquery.cookie.js'/>"></script>
<script src="js/aadl_select.js"></script>
<script type="text/javascript">
	$(function() {
		$("#template_list").hide();
		$(function() {
			var name= $.cookie('query_name');
			var des= $.cookie('query_des');
			$("#template_name").val(name);
			$("#template_description").val(des);
			$(".selector").val(groupid);
		});
	});
	
	function notUseTemplate(){
		var id = $.cookie('projectId');
		window.location.href="<%=request.getContextPath()%>/aadl/model/edit?projectId="+id; 
	}
</script>
<div class="page-header">
	<h3 style="margin-top: auto">
		选择系统架构模板
	</h3>
		<button class="btn" style="margin-bottom: 20px;"
			type="button"
			onclick="notUseTemplate()"><i class="icon-edit"></i>&nbsp;不使用模板</button>
	<div class="form-inline">
		<div><label class="control-label">项目类别</label>
					<select style="width: 200px" id="groupid" name="groupid" class="selector">
						<option value="0"></option>
						<c:choose>
							<c:when test="${!empty groups}">
								<c:forEach items="${groups}" var="list" varStatus="s">
									<option value="${list.id}">${list.name}</option>
								</c:forEach>
							</c:when>
						</c:choose>
					</select>
			<label class="control-label">名称</label><input type="text"
				style="margin-left: 10px;" class="input-large" placeholder="模板名称"
				id="template_name"><label style="margin-left: 50px;">描述信息</label><input
				type="text" style="margin-left: 10px;" class="input-xlarge"
				placeholder="模板描述信息" id="template_description">
				<button type="button" style="margin-left: 10px;width: 100px" class="btn"
				id="btn_add_div" onclick="queryTemplate(1)"><i class="icon-search"></i>&nbsp;开始检索</button>
		</div>
		<div style="margin-top: 10px;">
			
		</div>
	</div>
</div>
<div class="row-fluid">
	<div>
		<span id="search_reuslt"></span>
		<table class="table table-hover" id="template_list" style="width:80%">
			<thead>
				<tr>
					<th width="10%">编号</th>
					<th width="20%">名称</th>
					<th width="50%">描述信息</th>
					<th width="20%">操作</th>
				</tr>
			</thead>
			<tbody>
			</tbody>
			<tfoot>
			</tfoot>
		</table>
	</div>
</div>
<!--/span-->